﻿using System;
using EzDesk.Core.Interface;
using EzDesk.Utility.Log;

namespace EzDesk.Core.ServiceImpl.Services
{
    public class ClientTokenService : IClientTokenService
    {
        public ClientTokenService()
        {
            LogEx.TRACE("ServiceHost - ClientTokenService", "初始化ClientTokenService");
        }

        public string RequestToken(Guid userId)
        {
            return ClientTokenPool.Instance.RequestToken(userId);
        }

        public void UpdateToken(Guid userId)
        {
            ClientTokenPool.Instance.UpdateToken(userId);
        }

        public Guid GetUserIdByToken(string tokenString)
        {
            return ClientTokenPool.Instance.GetUserIdByToken(tokenString);
        }
    }
}
